{extend name="layout"}
{block name="detail"}

<section class="forms">
    <div class="container-fluid">
        <div class="row">
            <!-- Form Elements -->
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-header d-flex align-items-center">
                        <h3 class="h4">添加商品</h3>
                    </div>
                    <div class="card-body">
                        <form class="form-horizontal" method="post" action="{:url('admin/product/saveProduct')}" enctype="multipart/form-data" id="pFrom">
                            <input type="hidden" name="shopId" value="{$shop.id}">
                            <div class="form-group row">
                                <label for="title" class="col-sm-2 form-control-label">商品标题</label>
                                <div class="col-sm-9">
                                    <input id="title" type="text" required name="title"  class="form-control">
                                </div>
                            </div>

                            <div class="form-group row">
                                <label for="img" class="col-sm-2 form-control-label">请上传产品图片</label>
                                <div class="col-sm-9">
                                    <input id="img" type="file" required name="img" accept="image/*" multiple>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label  class="col-sm-2 form-control-label">是否上架</label>
                                <div class="col-sm-9">
                                    <input  type="radio" required name="isShow"  value="1" checked>是
                                    <input  type="radio" required name="isShow" value="0" >否
                                </div>
                            </div>

                            <div class="form-group row">
                                <label  class="col-sm-2 form-control-label">商品详情</label>
                                <div class="col-sm-9">
                                    <script id="container" name="info" type="text/plain"></script>
                                </div>
                            </div>
                            <p style="line-height: 40px">*系统建议代理利润不低于{$min_profit}%</p>
                            {for start="1" end="10"}
                            <div class="form-group row">
                                <div class="col-sm-2"></div>
                                <div class="col-sm-3">
                                    商品规格： <input id="guige[]" type="text"  name="guige[]"  class="form-control">
                                </div>

                                <div class="col-sm-3">
                                    商品卖价 <input id="salePrice[]" type="text"  name="salePrice[]"  class="form-control">
                                </div>

                                <div class="col-sm-3">
                                    商品代理价<input id="agentPrice[]" type="text"  name="agentPrice[]"  class="form-control agentPrice" >
                                </div>
                            </div>
                            {/for}


                            <div class="form-group row">
                                <div class="col-sm-4 offset-sm-3">
                                    <button type="submit" class="btn btn-primary">保存</button>
                                    <button type="reset" class="btn btn-secondary">重置</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/javascript" src="__STATIC__/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('container',{
        autoHeightEnabled: true,
        autoFloatEnabled: true,
        allowDivTransToP: false,
        initialFrameHeight:550,
    });
</script>
{/block}